﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Inspired.Euler.Tests
{
    /// <summary>
    /// Tests for problems from 40 to 49
    /// </summary>
    [TestClass]
    public class Problems040To049
    {
        [TestMethod]
        [Description("Finding the <i>n</i><sup>th</sup> digit of the fractional part of the irrational number.")]
        public void Problem040()
        {
            Assert.AreEqual(210, Euler.Problem040.Solve());
        }

        [TestMethod]
        [Description("What is the largest <i>n</i>-digit pandigital prime that exists?")]
        public void Problem041()
        {
            Assert.AreEqual(-1, Euler.Problem041.Solve());
        }

        [TestMethod]
        [Description("How many triangle words does the list of common English words contain?")]
        public void Problem042()
        {
            Assert.AreEqual(162, Euler.Problem042.Solve());
        }

        [TestMethod]
        [Description("Find the sum of all pandigital numbers with an unusual sub-string divisibility property.")]
        public void Problem043()
        {
            Assert.AreEqual(16695334890, Euler.Problem043.Solve());
        }

        [TestMethod]
        [Description("Find the smallest pair of pentagonal numbers whose sum and difference is pentagonal.")]
        public void Problem044()
        {
            Assert.AreEqual(5482660, Euler.Problem044.Solve());
        }

        [TestMethod]
        [Description("After 40755, what is the next triangle number that is also pentagonal and hexagonal?")]
        public void Problem045()
        {
            Assert.AreEqual(1533776805, Euler.Problem045.Solve());
        }

        [TestMethod]
        [Description("What is the smallest odd composite that cannot be written as the sum of a prime and twice a square?")]
        public void Problem046()
        {
            Assert.AreEqual(-1, Euler.Problem046.Solve());
        }

        [TestMethod]
        [Description("Find the first four consecutive integers to have four distinct primes factors.")]
        public void Problem047()
        {
            Assert.AreEqual(-1, Euler.Problem047.Solve());
        }

        [TestMethod]
        [Description("Find the last ten digits of 1<sup>1</sup> + 2<sup>2</sup> + ... + 1000<sup>1000</sup>.")]
        public void Problem048()
        {
            Assert.AreEqual(9110846700, Euler.Problem048.Solve());
        }

        [TestMethod]
        [Description("Find arithmetic sequences, made of prime terms, whose four digits are permutations of each other.")]
        public void Problem049()
        {
            Assert.AreEqual(-1, Euler.Problem049.Solve());
        }
    }
}
